type Person1 = {
    name: string;
    age: number;
    sayHello?: () => void;
};
let p1:Person1 = { name: "Alice", age: 25 };
console.log(p1); // { name: "Alice", age: 25 }
function greet(person: Person1) {
    console.log(`Hello, ${person.name}! You are ${person.age} years old.`);
}
p1.sayHello = () => {
    console.log(`Hello, ${p1.name}! You are ${p1.age} years old.`); 
}
let p2:Person1={ name: "Bob", age: 30 };
console.log(p2); // undefined
p1.sayHello(); // Hello, Alice! You are 25 years old.
greet(p1); // Hello, Alice! You are 25 years old.